/*
** display.c for bourseProject in /home/ralph/bourseProject/cac40
** 
** Made by Ralph
** Login   <ralph@epitech.net>
** 
** Started on  Wed Nov 28 21:05:15 2012 Ralph
** Last update Thu Nov 29 14:44:13 2012 Ralph
*/

#include	"my.h"

void		printTitle(char *line)
{
  int		i = 0;

  while (line[i])
    {
      while (line[i] && (isMaj(line[i]) != 0))
	i++;
      printf("L'action ");
      while (line[i] && (isMaj(line[i]) == 0) || (line[i] == ' ' && isMaj(line[i - 1]) == 0)
	     || (line[i] == '\''))
	printf("%c", line[i++]);
      return ;
    }
}

void		printQuote(char *line)
{
  int		i = 0;

  while (line[i])
    {
      while (line[i] && (isNum(line[i]) != 0))
	i++;
      printf(" cote actuellement a ");
      while (line[i] && (isNum(line[i]) == 0))
	printf("%c", line[i++]);
      return ;
    }
}

void		printVariation(char *line)
{
  int		i = 0;

  while (line[i])
    {
      while (line[i] && (isNum(line[i]) != 0) && line[i] != '-')
	i++;
      if (line[i] == '-' && isNum(line[i + 1]) != 0)
	i++;
      while (line[i] && (isNum(line[i]) != 0) && (line[i] != '-'))
	i++;
      printf(" EUROS, soit une variation de ");
      while ((line[i] && isNum(line[i]) == 0) || (line[i] == '-'))
	printf("%c", line[i++]);
      printf("%");
      return ;
    }
}

void		printVolume(char *line)
{
  int		i = 0;

  while (line[i])
    {
      while (line[i] && (isNum(line[i]) != 0))
	i++;
      printf(" pour un volume de ");
      while (line[i] && (isNum(line[i]) == 0) || (line[i] == ' ' && isNum(line[i - 1]) == 0))
	printf("%c", line[i++]);
      printf(" titres\n");
      return ;
    }
}
